<template>
	<view>
		<view class="header">
			<view class="left">
				设施基本信息
			</view>
			<view class="right" @tap="goEdit">
				<image src="/fireGridCheck/static/bianji.png" mode="scaleToFill" style="width: 28rpx;height: 28rpx;"></image>
				<view style="margin-left:6rpx">
					编辑
				</view>
			</view>
		</view>
		
		<view class="info-detail-info-item">
			设施类型：{{facilityType[info["设施类型"]]}}
		</view>
		<view class="info-detail-info-item">
			设施名称：{{info["设施名称"]}}
		</view>
		<!-- 	<view class="info-detail-info-item">
			设施编号：{{info["设施编号"]}}
		</view> -->

		<view class="info-detail-info-item">
			设施状态：{{info["设施状态"] == 1?'正常':"异常"}}
		</view>
		<!-- 	<view class="info-detail-info-item">
			所属网格：{{info["所属网格"]}}
		</view> -->
		<!-- 		<view class="info-detail-info-item">
			网格员：{{info["网格员"]}}
		</view>
		<view class="info-detail-info-item">
			网格长：{{info["网格长"]}}
		</view>
		<view class="info-detail-info-item">
			所属检查点：{{info["检查点"]}}
		</view>
		<view class="info-detail-info-item">
			所属检查类型：{{info['检查类型']}}
		</view> -->
		<view class="info-detail-info-item">
			具体位置：{{info['具体位置']}}
		</view>
		<view class="info-detail-info-item">
			生产日期：{{toLocalDate(info['生产日期'])}}
		</view>
		<view class="info-detail-info-item">
			核验日期：{{toLocalDate(info['核验日期'])}}
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {},
				id: null,
				facilityType: this.$type.facilityType,
				toLocalDate: this.$funs.toLocalDate
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getInstallDetail(+options.id)
		},
		methods: {
			getInstallDetail(id) {
				this.$http.post('gridSystem/device/info', {
					id
				}).then(res => {
					if (res.code === 10000) {
						this.info = res.data
					}
				})
			},
			goEdit() {
				uni.navigateTo({
					url: '../installtionDetail/installtionDetail?id=' + this.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.header {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	
		&::before {
			left: 20rpx;
			top: 20rpx;
			content: "";
			display: inline-block;
			width: 6rpx;
			height: 36rpx;
			background: #1064E9;
			position: absolute;
		}
	
		.left {
			padding: 20rpx 32rpx;
			font-size: 32rpx;
			color: #333333;
		}
	
		.right {
			display: flex;
			align-items: center;
			color: #5094FF;
		}
	}
	.right {
		display: flex;
		align-items: center;
		color: #5094FF;
		justify-content: flex-end;
		padding: 10rpx 20rpx;
	}
</style>
